<?php

class FileUtil { 
	static function uploadFile($model, $atribute) {
		$uploadedFile = CUploadedFile::getInstance($model, $atribute);
		$filename ="{$rnd}{$uploadedFile}";
		$uploadedFile->saveAs(Yii::app()->basePath.'/../images/'.$filename);
		
		return $filename;
	}
	
	static function deleteFile($filename) {
		return unlink(Yii::app()->basePath.'/../images/'.$filename);
	}
}
?>